package factoryGame;

import game.constants.ReferenceSpecialFeature;

import java.util.ArrayList;

import objects.SpetialFeature;
import constants.Constants;


public final class SpetialFeatureFactory {

	private static SpetialFeatureFactory instance = new SpetialFeatureFactory();
	
	public static ArrayList<SpetialFeature> listSpetialFeatures;
	
	private SpetialFeatureFactory(){
		
		listSpetialFeatures=new ArrayList<SpetialFeature>();
		listSpetialFeatures.add(getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_LIFE));
		listSpetialFeatures.add(getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_CURRENT_LIFE));
		listSpetialFeatures.add(getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_SPEED));
		listSpetialFeatures.add(getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_VISION_RANGE));
		listSpetialFeatures.add(getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_X_TO_MOVE));
		listSpetialFeatures.add(getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_Y_TO_MOVE));
		listSpetialFeatures.add(getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_IS_MOVING));
		listSpetialFeatures.add(getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_DAMAGE));
		listSpetialFeatures.add(getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_ATTACK_TIME));
		
		
		
	}
	
	public static SpetialFeature getSpetialFeature(int spetialFeatureReference){
		
		switch(spetialFeatureReference){
		case ReferenceSpecialFeature.SPETIAL_FEATURE_LIFE:
			return new SpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_LIFE,"Vida",100);
			
		case ReferenceSpecialFeature.SPETIAL_FEATURE_SPEED:
			return new SpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_SPEED,"Velocidad",0.06);
			
		case ReferenceSpecialFeature.SPETIAL_FEATURE_VISION_RANGE:
			return new SpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_VISION_RANGE,"Rango de Vision",200);
			
		case ReferenceSpecialFeature.SPETIAL_FEATURE_X_TO_MOVE:
			return new SpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_X_TO_MOVE,"X To Move",0);
			
		case ReferenceSpecialFeature.SPETIAL_FEATURE_Y_TO_MOVE:
			return new SpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_Y_TO_MOVE,"Y To Move",0);
			
		case ReferenceSpecialFeature.SPETIAL_FEATURE_IS_MOVING:
			return new SpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_IS_MOVING,"Status Movimiento",Constants.FALSE);  //>0 true   <0 false
			
		case ReferenceSpecialFeature.SPETIAL_FEATURE_DAMAGE:
			return new SpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_DAMAGE,"Danio",10); 
		case ReferenceSpecialFeature.SPETIAL_FEATURE_CURRENT_LIFE:
			return new SpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_CURRENT_LIFE,"Vida Actual",100);

		case ReferenceSpecialFeature.SPETIAL_FEATURE_ATTACK_TIME:
			return new SpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_ATTACK_TIME,"Tiempo de Ataque",1000);//time in seconds
			
		case ReferenceSpecialFeature.SPETIAL_FEATURE_X_BEGIN_AREA_TO_MOVE:
			return new SpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_X_BEGIN_AREA_TO_MOVE,"X BEGIN AREA TO MOVE",10);
			
		case ReferenceSpecialFeature.SPETIAL_FEATURE_Y_BEGIN_AREA_TO_MOVE:
			return new SpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_Y_BEGIN_AREA_TO_MOVE,"y BEGIN AREA TO MOVE",10);
			
		case ReferenceSpecialFeature.SPETIAL_FEATURE_X_END_AREA_TO_MOVE:
			return new SpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_X_END_AREA_TO_MOVE,"X END AREA TO MOVE",10);
			
		case ReferenceSpecialFeature.SPETIAL_FEATURE_Y_END_AREA_TO_MOVE:
			return new SpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_Y_END_AREA_TO_MOVE,"y END AREA TO MOVE",10);
		
		case ReferenceSpecialFeature.SPETIAL_FEATURE_TARGET_ID_TO_FOLLOW:
				return new SpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_TARGET_ID_TO_FOLLOW,"Target Id To Follow",Constants.NO_OBJECT_ID);
				
		case ReferenceSpecialFeature.SPETIAL_FEATURE_TARGET_ID_TO_ATTACK:
			return new SpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_TARGET_ID_TO_ATTACK,"Target Id To Attack",Constants.NO_OBJECT_ID);
			
		case ReferenceSpecialFeature.SPETIAL_FEATURE_ATTACK_RANGE:
			return new SpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_ATTACK_RANGE,"Attack Range",0);	
			
		case ReferenceSpecialFeature.SPETIAL_FEATURE_OBJECT_REFERENCE_TO_REVIVE:
			return new SpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_OBJECT_REFERENCE_TO_REVIVE,"Object Id To Revive",Constants.NO_OBJECT_REFERENCE);
			
		case ReferenceSpecialFeature.SPETIAL_FEATURE_TIME_TO_REVIVE:
			return new SpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_TIME_TO_REVIVE,"Object Id To Revive",10000);//ten seconds
			
		case ReferenceSpecialFeature.SPETIAL_FEATURE_MAX_NUMBER_OBJECTS_TO_CREATE:
			return new SpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_MAX_NUMBER_OBJECTS_TO_CREATE,"Max Number Objects",3);
			
		case ReferenceSpecialFeature.SPETIAL_FEATURE_CREATOR_ID:
			return new SpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_CREATOR_ID,"cREATOR iD",3);
		
		case ReferenceSpecialFeature.SPETIAL_FEATURE_OBJECT_EQUIPED:
			return new SpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_OBJECT_EQUIPED,"Equiped",Constants.FALSE);
			
		case ReferenceSpecialFeature.SPETIAL_FEATURE_CAN_PICKUP:
			return new SpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_CAN_PICKUP,"CAn i pick up",Constants.FALSE);
		}
		
		
		return null;
	}

}
